﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using AutoR.Services;
using LiteDB;
using Prism.Mvvm;

namespace AutoR.Models
{
	// Token: 0x020001E8 RID: 488
	public class UserFleet : BindableBase
	{
		// Token: 0x17000309 RID: 777
		// (get) Token: 0x06000AAF RID: 2735 RVA: 0x0006C65B File Offset: 0x0006A85B
		// (set) Token: 0x06000AB0 RID: 2736 RVA: 0x0006C664 File Offset: 0x0006A864
		public int id
		{
			[CompilerGenerated]
			get
			{
				return this.<id>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<id>k__BackingField == value)
				{
					return;
				}
				this.<id>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.id);
			}
		}

		// Token: 0x1700030A RID: 778
		// (get) Token: 0x06000AB1 RID: 2737 RVA: 0x0006C691 File Offset: 0x0006A891
		// (set) Token: 0x06000AB2 RID: 2738 RVA: 0x0006C69C File Offset: 0x0006A89C
		public List<int> ships
		{
			[CompilerGenerated]
			get
			{
				return this.<ships>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (object.Equals(this.<ships>k__BackingField, value))
				{
					return;
				}
				this.<ships>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.ships);
			}
		}

		// Token: 0x1700030B RID: 779
		// (get) Token: 0x06000AB3 RID: 2739 RVA: 0x0006C6CC File Offset: 0x0006A8CC
		// (set) Token: 0x06000AB4 RID: 2740 RVA: 0x0006C6D4 File Offset: 0x0006A8D4
		[BsonIgnore]
		public int status
		{
			[CompilerGenerated]
			get
			{
				return this.<status>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<status>k__BackingField == value)
				{
					return;
				}
				this.<status>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.status);
			}
		}

		// Token: 0x1700030C RID: 780
		// (get) Token: 0x06000AB5 RID: 2741 RVA: 0x0006C701 File Offset: 0x0006A901
		// (set) Token: 0x06000AB6 RID: 2742 RVA: 0x0006C70C File Offset: 0x0006A90C
		[BsonIgnore]
		public string title
		{
			[CompilerGenerated]
			get
			{
				return this.<title>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (string.Equals(this.<title>k__BackingField, value, StringComparison.Ordinal))
				{
					return;
				}
				this.<title>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.title);
			}
		}

		// Token: 0x1700030D RID: 781
		// (get) Token: 0x06000AB7 RID: 2743 RVA: 0x0006C73D File Offset: 0x0006A93D
		// (set) Token: 0x06000AB8 RID: 2744 RVA: 0x0006C748 File Offset: 0x0006A948
		[BsonIgnore]
		public List<UserShip> UserShip
		{
			[CompilerGenerated]
			get
			{
				return this.<UserShip>k__BackingField;
			}
			[CompilerGenerated]
			private set
			{
				if (object.Equals(this.<UserShip>k__BackingField, value))
				{
					return;
				}
				this.<UserShip>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.UserShip);
			}
		}

		// Token: 0x06000AB9 RID: 2745 RVA: 0x0006C778 File Offset: 0x0006A978
		public void UpdateShip()
		{
			List<UserShip> list = new List<UserShip>();
			using (List<int>.Enumerator enumerator = this.ships.GetEnumerator())
			{
				while (enumerator.MoveNext())
				{
					int sid = enumerator.Current;
					list.Add(Runtime.Game.UserShip.Single((UserShip i) => i != null && i.id == sid));
				}
			}
			this.UserShip = list;
		}

		// Token: 0x06000ABA RID: 2746 RVA: 0x0006C800 File Offset: 0x0006AA00
		public UserFleet()
		{
			this.<UserShip>k__BackingField = new List<UserShip>();
			base..ctor();
		}
	}
}
